<?php

class PI_Controller extends CI_Controller {
	var $plugin_name = '';

	function __construct(){
	  parent::__construct();
	  // 将插件目录加入到CI查找路径中
	  $this->load->add_package_path(PLUGIN_PATH.$this->plugin_name);
	 
	  // 加载模型
	  //Doctrine::loadModels(PLUGIN_PATH.$this->plugin_name.'/models/');
	}
	
	public function load_view($name,$vars = array(), $return = FALSE){
		$this->load->view($name,$vars,$return,$this->plugin_name);
	}
	function init_plugin_nam($file_dir=""){
	  $this->plugin_name = preg_replace("/^.+plugins\W(\w+)\Wcontrollers.*$/i", "$1",$file_dir, 1);
	}
	
}
?>